package com.techshine.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.techshine.common.base.BaseEntity;
import com.techshine.entity.Menu;
import com.techshine.mapper.MenuMapper;
import com.techshine.service.MenuService;

 
/** 
 * 说明： 菜单
 * 
 */
@Service
public class MenuServiceImpl implements MenuService {
	
	@Resource
	private MenuMapper menuMapper;
	@Override
	public Menu queryByKey(String id)throws Exception{
		return menuMapper.queryByKey(id);
	}
	@Override
	public List<Menu> queryListByPage(Menu entity)throws Exception{
		return menuMapper.queryListByPage(entity);
	}
	@Override
	public List<BaseEntity> queryList(Menu entity)throws Exception{
		return menuMapper.queryList(entity);
	}
	@Override
	public void insert(Menu entity)throws Exception{
		menuMapper.insert(entity);
	}
	@Override
	public void insertSelective(Menu entity)throws Exception{
		 menuMapper.insertSelective(entity);
	}
	@Override
	public void update(Menu entity)throws Exception{
	 	menuMapper.update(entity);
	}
	@Override
	public void updateByKeySelective(Menu entity)throws Exception{
		 menuMapper.updateByKeySelective(entity);
	}
	public void delete(Menu entity)throws Exception{
		 menuMapper.delete(entity);
	}
	@Override
	public void delmore(String ids) throws Exception {
		// TODO Auto-generated method stub
		String[] split = ids.split(",");
		Menu node=new Menu();
		for(String id:split) {
			node.setId(Integer.parseInt(id));
			menuMapper.delete(node);
		}
	}

	@Override
	public Menu querybyid(Menu entity) throws Exception{

			return  menuMapper.queryById(entity.getId().toString());
	}


}

